From : Steven Matty (Big.Will.Riker@ldngedgedemon.co.uk.limmat.ch)
Subject : Write to a bitmap in Blitz mode
> Hmm...erm...man I must be lame but I just can't solve a simple task:
>
> I just need to write some text to a bitmap in blitzmode...and
> I need to use any intuifont (from fonts:)...ok, i even
> managed to use graphics.library's and diskfont.library's commands
> via blitz (Move_ and Text_ etc.)...but now it turns out that
> somehow Text_ command (and BltBitMap_ also) won't run under
> Blitzmode...SO do we have some commands like in A*OS was Text?
>
> Any help - as always - VERY welcome ;)
Okey Orr here's how :
--------------8<-------------------------------
Statement IPLocate{x.w,y.w}
SHARED IP_x.w,IP_y.w
IP_x=x:IP_y=y
End Statement
Statement IPColour{fg.b,bg.b,style.b}
SHARED IP_bg.w,IP_fg.w,IP_style
IP_bg=bg
IP_fg=fg
IP_style=style
End Statement
Statement IPFont{font.b}
SHARED IP_font.b
IP_font=font
End Statement
Statement IPrint{bmp.b,t$}
SHARED IP_x,IP_y,rast.RastPort,IP_style,IP_fg,IP_bg,IP_font
InitRastPort_ &rast.RastPort ;<- okay. setup the rastport now...
rast\_BitMap=(Addr BitMap (bmp)) ;<- point to the bitmap and say, 'oi, raster - over there!'
IText.IntuiText\IText=Null(t$) ;<- dont forget to null terminate it now.... =P
IText\FrontPen=IP_fg ;<- set the fg pen
IText\BackPen=IP_bg ;<- makes no difference (possibly need different drawmode (JAM?))
IText\ITextFont=(Addr IntuiFont(IP_font)) ;<- set this=0 to get the default font
IText\ITextFont\ta_Style=IP_style
IText\LeftEdge=0 ;<- offset from points below
IText\TopEdge=0 ;<- offset from points below
PrintIText_ &rast,&IText,IP_x,IP_y
End Statement
.EXAMPLECODE
WBStartup
Screen 0,11 ;<- lets have a screen to play with
ScreensBitMap 0,0 ;<- and its bitmap...
Cls 3 ;<- i know, lets clear the bitmap for fun...
LoadFont 1,"helvetica.font",15
IPFont{1}
IPColour{1,0,3}
IPLocate{0,0}
IPrint{0,"Crap"}
IPColour{2,3,7}
IPLocate{10,10}
IPrint{0,"Thingy!"}
MouseWait
Free Screen 0
--------------8<-------------------------------
The Blitz Support Suite will feature an AmigaBitmapPrintLib which lets
you do things like NPrint to a bitmap whilst in Blitz Mode....